package com.dropTables.TakingNote;

import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import android.widget.ArrayAdapter;
import java.util.ArrayList;
import android.content.Intent;
import android.net.Uri;

public class NearByActivity extends ListActivity {
	private ArrayList<String> list;
	@Override
    public void onCreate(Bundle savedInstanceState)
    {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.reminder_list);
            Bundle extras = getIntent().getExtras();
    		if (extras != null) 
    		{
    			list = extras.getStringArrayList("locations");
    		}
    		fillData();
    }
	private void fillData() 
    {
        
        setListAdapter(new ArrayAdapter<String>(this, R.layout.reminder_row, list));
        
    }
	@Override
    protected void onListItemClick(ListView l, View v, int position, long id) 
    {
		String location = list.get(position);
		Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + location)); 
		startActivity(i);
    }

}
